import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { PostsModule } from './posts/posts.module';
import { StudentModule } from './student/student.module';
import { UserModule } from './user/user.module';

@Module({
  imports: [
		TypeOrmModule.forRoot({
			"type": "mysql",
			"host": "localhost",
			"port": 3306,
			"username": "root",
			"password": "root",
			"database": "blog",
			"entities": ["dist/**/*.entity{.ts,.js}"],
			"synchronize": true // 自动载入的模型将同步
		}),
		PostsModule,
		StudentModule,
		UserModule,
	],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
